﻿#pragma once
#include "afxdialogex.h"

// add by itas109 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#define HKEY_LOCAL_MACHINE_SERIALCOMM       "Hardware\\DeviceMap\\SerialComm"
// end by itas109xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#include <string>

// fct_uart_tool 对话框
class fct_uart_tool : public CDialogEx
{
	DECLARE_DYNAMIC(fct_uart_tool)

public:
	fct_uart_tool(CWnd* pParent = nullptr);   // 标准构造函数

	virtual ~fct_uart_tool();

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_UART_TOOL };
#endif

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual BOOL OnInitDialog();
	DECLARE_MESSAGE_MAP()

public:
	afx_msg void OnBnClickedOpenUart();
	afx_msg void OnBnClickedUartSendBtn();
	int UpdateSerailPortList(void);
	

private:
	CString m_strViewPortRecv;
	bool UartisOpen = false;


public:
	CComboBox m_fctUartPort;
	CComboBox m_fctUartBaudRate;
	void SerialPortBaudrateCtrlInit(void);
	void SerialPortNumberCtrlInit(void);
	afx_msg void OnCbnSelchangeComboSetUart();
	afx_msg void OnCbnSelchangeComboSetBand();
	void veiwPortRECV(std::string recv);
	afx_msg void OnBnClickedUartClearRecv();
	void SetUartBtnStatus();
};
